<template>
  <div class="app-container">
    <el-dialog
      ref="notebook"
      title="笔记"
      :visible="visible"
      append-to-body
      @close="close"
    >
      <div>
        <el-form :model="form" label-width="100px">
          <el-form-item label="笔记">
            <el-input     :rows="10"  v-model="form.area" type="textarea"></el-input>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer algin">
          <el-button type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'nootbook',

  data() {
    return {
      form: {
        area: "",
      },
    };
  },

  props: {
    visible: {
      type: Boolean,
      default: false,
    },
  },

  mounted() {
   
    this.form.area = localStorage.getItem("area");
    console.log("close",  this.form.area);;

  },

  methods: {
    submitForm() {
      localStorage.setItem("area", this.form.area);
      this.close();
    },

    cancel() {
      this.close();
    },
    close() {
      this.$emit("close", false);
    },
  },
};
</script>

<style>
.algin {
  text-align: center;
}
</style>
